package io.e4x.example.jnidemo.controller;

import io.e4x.example.jnidemo.service.StreamConnector;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class StreamController {

    @Autowired
    StreamConnector streamConnector;

    @GetMapping("connect")
    public String connect(@RequestParam("server") String server,@RequestParam("port") int port,@RequestParam("name") String name){
        streamConnector.connect(server, port, name);
        return "OK";
    }
}
